﻿namespace WebAPI中实现属性注入精简版.Code
{
    // 3. 服务接口与实现
    public interface ILoggerService
    {
        void Log(string message);
    }

    public class ConsoleLogger : ILoggerService
    {
        public void Log(string message) => Console.WriteLine($"日志: {message}");
    }

    public interface IUserService
    {
        string GetUserName(int id);
    }

    public class UserService : IUserService
    {
        public string GetUserName(int id) => $"用户{id}";
    }

}
